package cn.edu.ctbu.controller.user;

import cn.edu.ctbu.entity.Category;
import cn.edu.ctbu.result.Result;
import cn.edu.ctbu.service.ICategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("用户端分类接口")
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    ICategoryService iCategoryService;

    /**
     * 获得分类列表
     */
    @GetMapping
    @ApiOperation("查询分类")
    public Result<List<Category>> get(){
        List<Category> list=iCategoryService.getCategory();
        return Result.success(list);
    }
}
